package com.bonc.aoyuanbo.demo.service;

import com.bonc.aoyuanbo.demo.entity.SysUserTmp;
import com.bonc.aoyuanbo.demo.mapper.SysUserTmpMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 用户表(SysUserTmp)表服务实现类
 *
 * @author aoyuanbo
 * @since 2022-01-17 14:49:05
 */
@Service("sysUserTmpService")
public class SysUserTmpService{
    @Resource
    private SysUserTmpMapper sysUserTmpMapper;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    public SysUserTmp queryById(Integer id) {
        return this.sysUserTmpMapper.queryById(id);
    }
    

    /**
     * 新增数据
     *
     * @param sysUserTmp 实例对象
     * @return 实例对象
     */
    public SysUserTmp insert(SysUserTmp sysUserTmp) {
        this.sysUserTmpMapper.insert(sysUserTmp);
        return sysUserTmp;
    }

    /**
     * 修改数据
     *
     * @param sysUserTmp 实例对象
     * @return 实例对象
     */
    public SysUserTmp update(SysUserTmp sysUserTmp) {
        this.sysUserTmpMapper.update(sysUserTmp);
        return this.queryById(sysUserTmp.getId());
    }

       /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    public boolean deleteById(Integer id) {
        return this.sysUserTmpMapper.deleteById(id) > 0;
    }

}